#include "../include/camera.h"

// 构造函数定义
Camera::Camera(const std::string &model, const std::string &cameraType, int RGBResolutionWidth, int RGBResolutionHeight,
               int RGBFrameRate, int FOVWidth, int FOVHeight, int depthFrameRate)
    : model(model), cameraType(cameraType), RGBResolutionWidth(RGBResolutionWidth), RGBResolutionHeight(RGBResolutionHeight),
      RGBFrameRate(RGBFrameRate), FOVWidth(FOVWidth), FOVHeight(FOVHeight), depthFrameRate(depthFrameRate) {}

Camera::Camera(): Camera("RealSense D435i", "D430", 1920, 1080, 30, 87, 58, 90) {}

// 将属性写入文件的方法
void Camera::writeToFile(std::ofstream &file) {
    if (file.is_open()) {
        file << "双目摄像头：" << std::endl;
        file << " Model: " << model << std::endl;
        file << " Camera Type: " << cameraType << std::endl;
        file << " RGB Resolution Width: " << RGBResolutionWidth << std::endl;
        file << " RGB Resolution Height: " << RGBResolutionHeight << std::endl;
        file << " RGB Frame Rate: " << RGBFrameRate << std::endl;
        file << " FOV Width: " << FOVWidth << std::endl;
        file << " FOV Height: " << FOVHeight << std::endl;
        file << " Depth Frame Rate: " << depthFrameRate << std::endl;
    }
}

// 打印属性的方法
void Camera::print() const {
    std::cout << "双目摄像头：" << std::endl;
    std::cout << " Model: " << model << std::endl;
    std::cout << " Camera Type: " << cameraType << std::endl;
    std::cout << " RGB Resolution Width: " << RGBResolutionWidth << std::endl;
    std::cout << " RGB Resolution Height: " << RGBResolutionHeight << std::endl;
    std::cout << " RGB Frame Rate: " << RGBFrameRate << std::endl;
    std::cout << " FOV Width: " << FOVWidth << std::endl;
    std::cout << " FOV Height: " << FOVHeight << std::endl;
    std::cout << " Depth Frame Rate: " << depthFrameRate << std::endl;
}